package com.yuhs.zixing.study.design.pattern.dp002.create.c003.prototype.p001;

/**
 * @description:
 * @author: yuhs
 * @date: 2022/4/25 9:46 PM
 */
public class Sheep001 implements Cloneable {

    private String name;
    private String color;
    private int age;

    private String address = "蒙古羊";

    public Sheep001 friend;

    public Sheep001(String name, String color, int age) {
        super();
        this.name = name;
        this.color = color;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "Sheep{" + "name='" + name + '\'' + ", color='" + color + '\'' + ", age=" + age + ", address='" + address + '\'' + '}';
    }


    @Override
    protected Object clone() throws CloneNotSupportedException {
        Sheep001 sheep001 = null;

        try {
            sheep001 = (Sheep001) super.clone();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return sheep001;
    }
}
